import { Common } from '../../utils/common.js';
var common = new Common();


let Wxparse = require("../../wxParse/wxParse.js");

Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if (options.id)
      var id = options.id;
    var data = { id: id };
    var that = this;
    var datas = {
      data:data,
      type:'post',
      url:'article'
    }
    common.DataToData(datas, data => {
      that.setData({
        article_title: data.title,
        article_show: data.category_content[0].content,
      })
      wx.setNavigationBarTitle({
        title: data.title
      })
      Wxparse.wxParse('article', 'html', data.category_content[0].content, that, 5);
      console.log(data.category_content[0].content);
    })
  },
})